package com.yazi.mxz.person.jackson.using;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.yazi.mxz.common.entity.enums.OrderStatus;

public class OrderStatusSer extends JsonSerializer<OrderStatus> {

	@Override
	public void serialize(OrderStatus os, JsonGenerator gen, SerializerProvider provider)
			throws IOException, JsonProcessingException {
		gen.writeStartObject();
		gen.writeFieldName("ordinal");
		gen.writeNumber(os.ordinal());
		gen.writeFieldName("name");
		gen.writeString(os.name());
		gen.writeFieldName("memberText");
		gen.writeString(os.getMemberText());
		gen.writeFieldName("storeText");
		gen.writeString(os.getStoreText());
		gen.writeEndObject();
	}

}
